package com.aote.rs.helper;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import com.browsesoft.PropertiesService;

/**
 * 字符集帮助类
 * 
 */
public class CharacterSetHelper {

	/**
	 * rest数据解码
	 * @param str 数据
	 * @return    解码数据
	 */
	public static String restDecode(String str) {
		try {
			String characterset = PropertiesService.getProperty(
					"RestCharacterSet", "value");
			str = URLDecoder.decode(str, characterset);
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
		return str;
	}
}
